<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    function Fn(){}
    function Fun(){}
    function Foo(){}

    Fn.prototype = new Fun();

    const fn = new Fn();
    const fun = new Fun();
    const foo = new Foo();

    // 当前所属的原型对象的构造函数
    console.log(Foo.prototype.constructor === Foo);

    console.log(Fun.prototype.constructor === fun.__proto__.constructor);
    console.log(Fun.prototype.constructor === fun.constructor);
    

    // 因为Fn.prototype = new Fun()，所以Fn.prototype是Fun的实例
    console.log(Fun.prototype.constructor === Fn.prototype.constructor);
    console.log(Fun === Fn.prototype.constructor);
    




    // console.log( Fn.prototype.isPrototypeOf(fn) );
    // console.log( Fun.prototype.isPrototypeOf(fun) );
    // console.log( Foo.prototype.isPrototypeOf(foo) );
    // console.log( Fun.prototype.isPrototypeOf(fn) );
    // console.log( Fn.prototype.isPrototypeOf(fun) );

    // console.log( Object.prototype.isPrototypeOf(fn) );
    // console.log( Object.prototype.isPrototypeOf(fun) );
    // console.log( Object.prototype.isPrototypeOf(foo) );
    // console.log( Object.prototype.isPrototypeOf(Fn) );
    // console.log( Object.prototype.isPrototypeOf(Fun) );
    // console.log( Object.prototype.isPrototypeOf(Foo) );

    // console.log( fn instanceof Fn );
    // console.log( fun instanceof Fun );
    // console.log( foo instanceof Foo );
    // console.log( fn instanceof Foo );
    // console.log( fun instanceof Foo );
    
    // console.log( fn instanceof Fun );
    
    // console.log( fn instanceof Object );
    // console.log( fun instanceof Object );
    // console.log( foo instanceof Object );
    // console.log( Fn instanceof Object );
    // console.log( Fun instanceof Object );
    // console.log( Foo instanceof Object );
    
    // console.log( new String("hello") instanceof Object );
    // console.log( new Number(12312) instanceof Object );



    
</script>
</html>